<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>

<body>
    <div id="app">
        <a v-bind:href="baidu">百度一下</a><br>
        <!-- 简写 -->
        <a :href="baidu">百度一下1</a><br>
        <!-- 双向数据绑定：v-model底层实现的原理 -->
        <div>{{msg}}</div>
        <input type="text" :value="msg" @input="handler">
        <input type="text" :value="msg" @input="msg=$event.target.value">
    </div>
    <script type="text/javascript" src="js/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                baidu: 'http://www.baidu.com',
                msg: "abc"
            },
            methods: {
                handler: function (e) {
                    this.msg = e.target.value
                }
            },
        })
    </script>
</body>

</html>